package com.keshan.service.impl;

import com.keshan.mapper.SwitchMachineMapper;
import com.keshan.pojo.SwitchMachine;
import com.keshan.pojo.SwitchMachineExample;
import com.keshan.service.SwitchMachineServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author keshan
 * @date 2022/10/21 - 19:52
 */
@Service
public class SwitchMachineServicesImpl implements SwitchMachineServices {
    @Autowired
    SwitchMachineMapper switchMachineMapper;
    @Override
    public int insertBySelectiveSwitchMachine(SwitchMachine switchMachine) {
        return switchMachineMapper.insertSelective(switchMachine);
    }

    @Override
    public List<SwitchMachine> getSwitchMachineListByImei(String imei) {
        SwitchMachineExample switchMachineExample = new SwitchMachineExample();
        SwitchMachineExample.Criteria criteria = switchMachineExample.createCriteria();
        criteria.andImeiEqualTo(imei);
        return switchMachineMapper.selectByExample(switchMachineExample);
    }
}
